<script setup lang="ts">
import { computed, inject, provide } from 'vue'

import ReceivingImg from '@renderer/views/multiScanSeriesPage/components/normalScanContent/receivingImg/ReceivingImg.vue'
import NormalScanWaitCondition
  from '@renderer/views/multiScanSeriesPage/components/normalScanContent/waitScoutImg/NormalScanWaitCondition.vue'
import { EnumScanStatus, NormalScanSeries } from '@renderer/views/multiScanSeriesPage/types'
import NormalScanHasScout
  from '@renderer/views/multiScanSeriesPage/components/normalScanContent/hasScoutImg/NormalScanHasScout.vue'

const { scanSeriesArr, activeScanSeries } = inject('multiSeries') as any
const props = defineProps(['seriesId', 'imageIds','scoutImageIds'])

const currentSeriesInfoRef = computed<NormalScanSeries>(() => {
  return scanSeriesArr.filter((series: any) => series.id === props.seriesId)[0]
})
</script>

<template>
  <div class="w-full h-full">
    <!--      已经有了螺旋/断层扫描的影像-->
    <!--      只有平片影像 -->
    <!--      平片影像还没有 -->
    <keep-alive>
      <receiving-img v-if="activeScanSeries.id === currentSeriesInfoRef.id && [EnumScanStatus.scan_img_folder_created, EnumScanStatus.getting_img].includes(currentSeriesInfoRef.status)"
               :seriesId="props.seriesId"
               :image-ids="props.imageIds"
      />
      <normal-scan-has-scout
        :seriesId="props.seriesId"
        :imageIds="props.scoutImageIds"
        v-else-if="activeScanSeries.id === currentSeriesInfoRef.id && currentSeriesInfoRef.hasScoutImage" />
      <normal-scan-wait-condition
        v-else-if="activeScanSeries.id === currentSeriesInfoRef.id"></normal-scan-wait-condition>
    </keep-alive>
  </div>
</template>

<style scoped>

</style>
